export {}

// interface接口类型 -- 主要针对对象进行注解
interface Person {
    name: string,
    age: number
}

const obj: Person = {
    name: 'John',
    age: 34
}
console.log(obj)

// 表单收集场景说明
interface LoginForm {
    username: string,
    password: string
}

let formData: LoginForm = {
    username: 'John',
    password: 'password'
}
console.log(formData)

// 渲染场景说明
interface Goods {
    id: string,
    price: number
}

let list: Goods[] = [
    {
        id: '123',
        price: 100
    }
]
list.forEach(item=>item.price)